//
//  BassTableViewController.swift
//  新浪微博
//
//  Created by mac on 15/10/8.
//  Copyright © 2015年 mac. All rights reserved.
//

import UIKit

class BassTableViewController: UITableViewController, VisitorLoginViewDelegate {
    
    var userLogin = false
    var visitorView :VisitorLoginView?
    
    override func loadView() {
        
        userLogin ? super.loadView() : setupVisitorView()
        
    }

    // 设置访客视图
    private func setupVisitorView() {
    
        visitorView = VisitorLoginView()
        visitorView?.delegate = self
        
        view = visitorView
        
        // 设置导航按钮
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "visitorLoginViewWillRegister")
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "visitorLoginViewWillLogin")

    }
    
    // MARK: - VisitorLoginViewDelegate
    
    func visitorLoginViewWillRegister() {
        print("注册")
    }
    
    func visitorLoginViewWillLogin() {
        print("登录")
    }
    
}
